<template>
	<div class="mine_mm">
		<main class="mine_layout">
			<section class="mine_infos clearfix">
				<div class="mmm_info">
					<div class="user_icon">
						<img src="../assets/images/head.jpg" alt="">
					</div>
					<div class="user_detal">
						<p class="user_name">{{uInfs.username}}</p>
						<div class="reg">
							<!-- <a href="#" class="reg_link">注册会员</a> -->
							<div class="vip">
								<span class="vip_icon">
									<img src="../assets/images/vip.png" alt="">
								</span>
								<a href="#">
									机构会员尊享
								</a>
							</div>
						</div>
					</div>
					<div class="manage_account" >
						<span @click="goMechanism" style="margin-top: 100%;float: right;color: white;">
							账户管理 >
						</span>
					</div>
				</div>
				<!-- <div class="yguanzhu_box">
	            <ul class="gunzhuf">
	                <li class="item">
	                    <a href="" class="item_link">
	                        <span>0</span>
	                        <span>关注的商品</span>
	                    </a>
	                </li>
	                <li class="item">
	                    <a href="" class="item_link">
	                        <span>0</span>
	                        <span>关注的店铺</span>
	                    </a>
	                </li>
	                <li class="item">
	                    <a href="" class="item_link">
	                        <span>8</span>
	                        <span>浏览记录</span>
	                    </a>
	                </li>
	            </ul>
	        </div> -->
			</section>
			<section class="my_order_box">
				<div class="order_top_box">
					<div class="order_left">
						<img src="../assets/images/my_order_icon.png" alt="">
						<span>我的订单</span>
					</div>
					<router-link :to="'/order/'+(status=0)" class="tabItem">
						<div class="order_right">
							<span>全部订单></span>
						</div>
					</router-link>
				</div>
				<div class="order_bottom_box">
					<ul>
						<li class="order_item">
							<router-link :to="'/order/'+(status=1)" class="tabItem">
								<a href="#" class="order_item_link">
									<img src="../assets/images/waitpay.png" alt="" class="order_item_pic">
									<span class="order_item_pay">待付款</span>
								</a>
								<div class="order_base order_waitpay" v-if="dfk != 0">
									{{dfk}}
								</div>
							</router-link>
						</li>
						<li class="order_item">
							<router-link :to="'/order/'+(status=2)" class="tabItem">
								<a href="#" class="order_item_link">
									<img src="../assets/images/yifukuan.png" alt="" class="order_item_pic">
									<span class="order_item_pay">已付款</span>
								</a>
							</router-link>
						</li>
						<li class="order_item">
							<router-link :to="'/order/'+(status=3)" class="tabItem">
								<a href="#" class="order_item_link">
									<img src="../assets/images/wuliu.png" alt="" class="order_item_pic">
									<span class="order_item_pay">待收货</span>
								</a>
								<div class="order_base order_dsh" v-if="dsh != 0">
									{{dsh}}
								</div>
							</router-link>
						</li>
						<li class="order_item">
							<router-link :to="'/order/'+(status=4)" class="tabItem">
								<a href="#" class="order_item_link">
									<img src="../assets/images/received.png" alt="" class="order_item_pic">
									<span class="order_item_pay">已收货</span>
								</a>
							</router-link>
						</li>
					</ul>
				</div>
			</section>
			<section class="my_order_box">
				<div class="order_top_box">
					<div class="order_left">
						<img src="../assets/images/mypackage.png" alt="">
						<span>我的钱包</span>
					</div>
					<div class="order_right">
						<span></span>
					</div>
				</div>
				<div class="order_bottom_box">
					<ul>
						<li class="order_item">
							<a href="#" class="order_item_link">
								<span style="margin-top: -5px;display: block" v-if="uInfs.balance != null">{{uInfs.balance}}</span>
								<span style="margin-top: -5px;display: block" v-if="uInfs.balance == null">0</span>
								<span class="order_item_pay">爱币余额</span>
							</a>
						</li>
						<li class="order_item">
							<a href="#" class="order_item_link">
								<span style="margin-top: -6px;display: block">0</span>
								<span class="order_item_pay">积分</span>
							</a>
						</li>
						<!-- <li class="order_item">
	                    <a href="#" class="order_item_link">
	                        <span style="margin-top: -6px;display: block">0</span>
	                        <span class="order_item_pay">京豆</span>
	                    </a>
	                </li>
	                <li class="order_item">
	                    <a href="#" class="order_item_link">
	                        <span style="margin-top: -6px;display: block">0</span>
	                        <span class="order_item_pay">京东卡/E卡</span>
	                    </a>
	                </li> -->
					</ul>
				</div>
			</section>
			<section class="my_order_box my_b_info">
				<div class="order_top_box" @click="goCollect()">
					<div class="order_left">
						<img style="width: 26px;height: 25px;top: 8px; left: -3px;" src="../assets/images/collection.png" alt="">
						<span>我的收藏</span>
					</div>
					<div class="order_right">
						<span>关注的商品></span>
					</div>
				</div>
				<div class="order_top_box" @click="goFootprint()">
					<div class="order_left">
						<img style="width: 26px;height: 25px;top: 8px; left: -3px;" src="../assets/images/footprint.png" alt="">
						<span>我的足迹</span>
					</div>
					<div class="order_right">
						<span>浏览记录></span>
					</div>
				</div>
				<div class="order_top_box" @click="goAddress()">
					<div class="order_left">
						<img style="width: 26px;height: 25px;top: 8px; left: -3px;" src="../assets/images/address.png" alt="">
						<span>我的地址</span>
					</div>
					<div class="order_right">
						<span>我的收货地址></span>
					</div>
				</div>
			</section>
			<!-- <section class="my_order_box my_b_info">

				<div class="order_top_box">
					<div class="order_left">
						<img src="../assets/images/baitiao2.png" alt="">
						<span>客户服务</span>
					</div>
					<div class="order_right">
						<span>返修/退换货、在线客服></span>
					</div>
				</div>
				<div class="order_top_box">
					<div class="order_left">
						<img src="../assets/images/bai3.png" alt="">
						<span>会员plus</span>
					</div>
					<div class="order_right">
						<span>PLUS绝密攻略></span>
					</div>
				</div>
				<!-- <div class="order_top_box">
	            <div class="order_left">
	                <img src="../assets/images/bai4.png" alt="">
	                <span>京东会员</span>
	            </div>
	            <div class="order_right">
	                <span>会员俱乐部></span>
	            </div>
	        </div> -->
			<!-- </section> -->
			<!-- <section class="my_order_box my_b_info"> -->
			<!-- <div class="order_top_box">
	            <div class="order_left">
	                <img src="../assets/images/huo1.png" alt="">
	                <span>京东火车票</span>
	            </div>
	            <div class="order_right">
	                <span>来京东轻松抢票></span>
	            </div>
	        </div>
	        <div class="order_top_box">
	            <div class="order_left">
	                <img src="../assets/images/huo2.png" alt="">
	                <span>1元抢宝</span>
	            </div>
	            <div class="order_right">
	                <span>1元成就梦想></span>
	            </div>
	        </div>
	        <div class="order_top_box">
	            <div class="order_left">
	                <img src="../assets/images/huo3.png" alt="">
	                <span>我的预约</span>
	            </div>
	            <div class="order_right">
	                <span>></span>
	            </div>
	        </div>
	        <div class="order_top_box">
	            <div class="order_left">
	                <img src="../assets/images/huo4.png" alt="">
	                <span>我的必购码</span>
	            </div>
	            <div class="order_right">
	                <span>></span>
	            </div>
	        </div> -->
			<!-- <div class="order_top_box">
					<div class="order_left">
						<img src="../assets/images/huo5.jpg" alt="">
						<span>应用推荐</span>
					</div>
					<div class="order_right">
						<span>></span>
					</div>
				</div>
			</section> -->
		</main>
	</div>
</template>
<script>
export default {
  data() {
    return {
      uInfs: {},
	  checkout: false,
	  dfk: 0,
	  dsh: 0,
    }
  },
  mounted() {
    this.getUDatas()
  },
  methods: {
    goCollect() {
      this.$router.push('/collect')
    },
    goFootprint() {
      this.$router.push('/footPrint')
    },
    goAddress() {
      const type = 1
      this.$router.push('/address/' + type)
    },
    goMechanism() {
      this.$router.push('/mechanism')
    },
    getUDatas() {
      let _this = this
      let uObj = {}
      if (window.sessionStorage.userInfo) {
        let uObj = JSON.parse(window.sessionStorage.userInfo)
        console.log(uObj)
        let useId = uObj.id
        _this.$http
          .get('/mechanismadmin/mobile/userinfo', {
            params: {
              useId: useId
            }
          })
          .then(
            res => {
			  _this.uInfs = res.data.data.user
			  _this.dfk = res.data.data.dfk
			  _this.dsh = res.data.data.dsh
			  if (_this.dfk > 99) {
				_this.dfk = '99+'
			  }
			  if (_this.dsh > 99) {
				_this.dsh = '99+'
			  }
              console.log(_this.uInfs)
            },
            err => {
              console.log(err)
            }
          )
      } else {
        _this.$router.push({
          path: '/login'
        })
      }
    }
  }
}
</script>
<style>
.mine_layout {
  margin-bottom: 500px;
}
.order_base {
  height: 17px;
  width: 17px;
  z-index: 10;
  /* position: absolute; */
  background: #b4282d;
  text-align: center;
  font-size: 9px;
  color: #fff;
  line-height: 17px;
  border-radius: 50%;
  margin-top: -103%;
  margin-left:65%;
}
.order_waitpay {
  top: 33%;
  right: 82%;
}
.order_dsh {
  top: 33%;
  right: 34%;
}
</style>

